package utilDataStruct;

import java.util.ArrayList;
import java.util.List;

import dataFromXml.FileFilter;

public class FileStruct {
	
	String tableName;
	List<String> attrNameList;
	List<String> attrTypeList;
	
	public FileStruct(FileFilter ffNode) {
		tableName = ffNode.getTableName();
		attrNameList = new ArrayList<>();
		attrTypeList = new ArrayList<>();
		
		String[] ss;
		ss = ffNode.getAttrNames().split(" ");
		for (String s : ss) {
			attrNameList.add(s);
		}
		ss = ffNode.getAttrTypes().split(" ");
		for (String s : ss) {
			attrTypeList.add(s);
		}
	}
	
	public FileStruct(String tName, String aNames, String aTypes) {
		
		tableName = tName;
		attrNameList = new ArrayList<>();
		attrTypeList = new ArrayList<>();
		
		String[] ss;
		ss = aNames.split(" ");
		for (String s : ss) {
			attrNameList.add(s);
		}
		ss = aTypes.split(" ");
		for (String s : ss) {
			attrTypeList.add(s);
		}
	}
	
	public String getTableName() {
		return tableName;
	}
	
	public List<String> getAttrNameList() {
		return attrNameList;
	}
	
	public List<String> getAttrTypeList() {
		return attrTypeList;
	}
}
